<?php
require_once("rsslib.php");
/*
      -- get only Monitorix
      $data = "1=1";

      foreach( $_GET as $key => $value){
            $data = $data . "&" . $key . "=" . $value;
      }

      require_once("rsslib.php");
	$url = "http://api.monitorix.biz/app?c=jGcDJfabZTBTwB" . $data;
  echo RSS_Display($url, 15);
*/

function getpost_ifset($name_test_var, $defval=NULL)
{
  $test_var = $defval;
  if (isset($_POST[$name_test_var]))
  {
    $test_var = $_POST[$name_test_var];
  }
  elseif (isset($_GET[$name_test_var]))
  {
    $test_var = $_GET[$name_test_var];
  }

  return( $test_var );
}

$fulltext = getpost_ifset('fulltext', "1");
$query_meta = urlencode(iconv( 'utf-8', 'windows-1251', getpost_ifset('query_meta', "")));
$query_mx = urlencode(iconv( 'utf-8', 'windows-1251', getpost_ifset('query_mx', "")));

$url = "http://www.w3monitor.com/search_apps/rss_feed.php?query_meta=$query_meta&query_mx=$query_mx&fulltext=$fulltext";
//$url = "http://www.w3monitor.com/search_apps/rss_feed.php?query_meta=%F2%E8%E3%E8%EF%EA%EE&query_mx=%F2%E8%E3%E8%EF%EA%EE&fulltext=1";
echo RSS_Display($url, 50);
//echo "<br>$url";
?>

